<?php

namespace App\Models;

/**
 * 后台管理员操作日志
 */
class MAdminOperaLog extends BaseModel
{
    public $table = "admin_opera_log";    //指定表名


    /** 管理员操作动作执行
     * @param $admin 管理员id
     * $do 执行动作
     * $content 执行内容
     */
    public static function log($id, $ip, $do, $content)
    {
        $log = new MAdminOperaLog();
        $log->admin_id = $id;
        $log->do = $do;
        $log->content = $content;
        $log->opera_ip = $ip;
        $log->opera_time = time();

        return $log->save();
    }
}